<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="java.util.Date"%>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 <c:set var="date" value="<%=new Date() %>"/> 
<fmt:formatDate var ="today" value="${date }" type="date" pattern="yyyy-MM-dd HH:mm:ss"/>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
//each() : $("배열 셀렉터").each(function)  - jQuery 객체가 가지고 있는 배열 객체의 크기 만큼 반복하면서 함수 호출
/* 
$(":checkbox:checked").each(function(){
	txt = txt +$(this).val()+", ";
})
*/

$("#showLayer").text(txt);
function createInput(){
	var inputTxt = document.createElement("input");
	var sp = document.getElementById("inputCategorySpace");
	inputTxt.name = "category";
	inputTxt.type ="text";
	sp.appendChild(inputTxt);
}
function chk(){
	if( inputAdminBoard.boardName.value==""){
		alert("게시판명을 입력해주세요.");
		return ;n
	}
	if( inputAdminBoard.adminName.value==""){
		alert("등록자명을 입력해주세요.");
		return ;
	}
	if(inputAdminBoard.explanation.value==""){
		alert("설명을 입력해주세요.");
		return;
	}
	
	var url = "/${initParam.context_root }/registerAdminBoard.do";
	$("#inputAdminBoard").attr({"action":url,"method":"post"}).submit();

}
</script>
<title>관리자용 화면</title>
</head>
<body>
<form id="inputAdminBoard" name="inputAdminBoard">
<div align="right">
	<a href="/${initParam.context_root }/typeNine.do">[이전]</a>&nbsp; <a href="javascript:chk();" >[완료]</a>&nbsp; <a href="/${initParam.context_root }/ViewForRegisterAdminBoard.do">[취소]</a>
</div>
ν 기본정보<br>
<table border="2" width="800px">
	<tr>
		<th bgcolor="lightgray" width="220px">게시판 명</th>
		<td colspan="3"><input type="text" name="boardName" style="width: 660px;" maxlength="20"></td>
	</tr>
	<tr>
		<th bgcolor="lightgray">등록자</th>
		<td><input type="text" name="adminName" maxlength="10"></td>
		<th bgcolor="lightgray">등록일시</th>
		<td><input type="text" value="${today }" name="registerDate" readonly="readonly" style="border: 0px; padding-left: 5px;"></td>
	</tr>
	<tr>
		<th bgcolor="lightgray">설명</th>
		<td  colspan="3"><input type="text" name="explanation" style="width: 660px;" maxlength="30"></td>
	</tr>
</table><br>
ν 선택정보<br>
<table border="2" width="800px">
	<tr>
		<th bgcolor="lightgray" >게시판종류</th>
		<td width=665px;><label><input type="radio" name="boardType" value="일반형" checked="checked">일반형</label>
			<label><input type="radio" name="boardType" value="자료실형">자료실형</label>
			<label><input type="radio" name="boardType" value="QnA형">QnA형</label>
			<label><input type="radio" name="boardType" value="FAQ형">FAQ형</label>
			<label><input type="radio" name="boardType" value="이미지형">이미지형</label>
		</td>
	</tr>
	<tr>
		<th bgcolor="lightgray">카테고리</th>
		<td><input type="text" name="category" value="공지사항" maxlength="8"><span id="inputCategorySpace"></span><a href="javascript:createInput()">[+]</a>
		</td>
	</tr>
	<tr>
		<th bgcolor="lightgray">옵션</th>
		<td>
		<label><input type="checkbox" class="boardOption"  value="답글" name="option">답글(Reply) 사용</label><br>
		<label><input type="checkbox" class="boardOption" value="댓글" name="option">댓글(Comment) 사용</label><br>
		<label><input type="checkbox" class="boardOption" value="첨부" name="option">파일첨부 사용</label><br>
		<label><input type="checkbox" class="boardOption" value="기간" name="option">게시기간 사용</label><br>
		<label><input type="checkbox" class="boardOption" value="익명" name="option">익명글쓰기 사용</label><br>
		<label><input type="checkbox" class="boardOption" value="최상위" name="option">최상위공지 사용</label><br>
		<label><input type="checkbox" class="boardOption" value="권한" name="option">게시글 권한설정 사용</label><br>
		</td>
	</tr>
</table><br>
ν 권한정보<br>
<table border="2" width="800px">
	<tr>
		<th  bgcolor="lightgray" width="100px">관리 권한</th>
		<td ><select name="adminConstraint">
				<option value="0">선택하세요.</option>
				<option value="yes">Yes(관리권한이 생깁니다.)</option>
				<option value="no" selected="selected">No</option>
		</select>
		</td>
	</tr>
	<tr>
		<th bgcolor="lightgray"  width="220px">작성 권한</th>
		<td><select name="writeConstraint">
		<option value="0">선택하세요.</option>
				<option value="yes">Yes(작성 권한이 생깁니다.)</option>
				<option value="no" selected="selected">No</option>
		</select></td>
	</tr>
	<tr>
		<th bgcolor="lightgray"  width="220px">읽기 권한</th>
		<td><select name="readConstraint">
		<option value="0">선택하세요.</option>
				<option value="yes" >Yes(읽기 권한이 생깁니다.)</option>
				<option value="no" selected="selected">No</option>
		</select></td>
	</tr>
</table>
<div align="right">
	<a href="/${initParam.context_root }/typeNine.do">[이전]</a>&nbsp; <a href="javascript:chk();" >[완료]</a>&nbsp; <a href="/${initParam.context_root }/ViewForRegisterAdminBoard.do">[취소]</a>
</div>
</form>
</body>
</html>